﻿/******************************************************************************
 *  作者：       Administrator
 *  创建时间：   2013/5/11 16:37:56
 *
 *
 ******************************************************************************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace CollectionAndShare
{
    /// <summary>
    /// Collection.xaml 的交互逻辑
    /// </summary>
    public partial class Notebook : UserControl
    {
        public Notebook()
        {
            InitializeComponent();

            this.lstCollection.ItemsSource = Collections.CreateCollections();
        }

        public Notebook(CateCollection cate)
        {
            InitializeComponent();

            this.lstCollection.ItemsSource = Collections.CreateCollections2();

            this.collectionContent.AppendText("WPF中,怎样使自定义控件填满grid的一个单元格WPF中,怎样使自定义控件填满grid的一个单元格WPF中,怎样使自定义控件填满grid的一个单元格");
        }        

        private void lstCollection_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            this.collectionContent.AppendText("演讲中马云再次提及自己“给年轻人机会”的理念。马云说，工业时代是论资排辈，永远需要一个 Rich Father，但如今变化的时代是年轻人的时代。“我们还没搞懂 PC 互联网的时候，移动互联网来了，我们还没搞懂移动互联网的时候，大数据来了");
        }
    }

    public class Collections
    {
        public string Icon { get; set; }

        public string Name { get; set; }

        public string Date { get; set; }

        public Collections(string icon, string name, string date)
        {
            this.Icon = icon;
            this.Name = name;
            this.Date = date;
        }

        public static List<Collections> CreateCollections()
        {
            Collections collection01 = new Collections("", "WPF中,怎样使自定义控件填满grid的一个单元格", DateTime.Now.ToShortDateString());
            Collections collection02 = new Collections("", "My God is ...", DateTime.Now.ToShortDateString());
            Collections collection03 = new Collections("", "WPF中,怎样使自定义控件填满grid的一个单元格", DateTime.Now.ToShortDateString());
            Collections collection04 = new Collections("", "Are you sure", DateTime.Now.ToShortDateString());
            Collections collection05 = new Collections("", "WPF中,怎样使自定义控件填满grid的一个单元格", DateTime.Now.ToShortDateString());
            Collections collection06 = new Collections("", "Are you sure", DateTime.Now.ToShortDateString());
            Collections collection07 = new Collections("", "WPF中,怎样使自定义控件填满grid的一个单元格", DateTime.Now.ToShortDateString());
            Collections collection08 = new Collections("", "Are you sure", DateTime.Now.ToShortDateString());
            Collections collection09 = new Collections("", "WPF中,怎样使自定义控件填满grid的一个单元格", DateTime.Now.ToShortDateString());
            Collections collection10 = new Collections("", "Are you sure", DateTime.Now.ToShortDateString());
            Collections collection11 = new Collections("", "WPF中,怎样使自定义控件填满grid的一个单元格", DateTime.Now.ToShortDateString());
            Collections collection12 = new Collections("", "WPF中,怎样使自定义控件填满grid的一个单元格", DateTime.Now.ToShortDateString());
            Collections collection13 = new Collections("", "WPF中,怎样使自定义控件填满grid的一个单元格", DateTime.Now.ToShortDateString());
            Collections collection14 = new Collections("", "WPF中,怎样使自定义控件填满grid的一个单元格", DateTime.Now.ToShortDateString());
            List<Collections> listCollection = new List<Collections>();
            listCollection.Add(collection01);
            listCollection.Add(collection02);
            listCollection.Add(collection03);
            listCollection.Add(collection04);
            listCollection.Add(collection05);
            listCollection.Add(collection06);
            listCollection.Add(collection07);
            listCollection.Add(collection08);
            listCollection.Add(collection09);
            listCollection.Add(collection10);
            listCollection.Add(collection11);
            listCollection.Add(collection12);
            listCollection.Add(collection13);
            listCollection.Add(collection14);
            return listCollection;
        }

        public static List<Collections> CreateCollections2()
        {
            Collections collection01 = new Collections("", "AAWPF中,怎样使自定义控件填满grid的一个单元格", DateTime.Now.ToShortDateString());
            Collections collection02 = new Collections("", "AAMy God is ...", DateTime.Now.ToShortDateString());
            Collections collection03 = new Collections("", "SSWPF中,怎样使自定义控件填满grid的一个单元格", DateTime.Now.ToShortDateString());
            Collections collection04 = new Collections("", "DFDAre you sure", DateTime.Now.ToShortDateString());
            Collections collection05 = new Collections("", "DDDWPF中,怎样使自定义控件填满grid的一个单元格", DateTime.Now.ToShortDateString());
            Collections collection06 = new Collections("", "DDDAre you sure", DateTime.Now.ToShortDateString());
            Collections collection07 = new Collections("", "SSSSSWPF中,怎样使自定义控件填满grid的一个单元格", DateTime.Now.ToShortDateString());
            Collections collection08 = new Collections("", "Are you sure", DateTime.Now.ToShortDateString());
            Collections collection09 = new Collections("", "WPF中,怎样使自定义控件填满grid的一个单元格", DateTime.Now.ToShortDateString());
            Collections collection10 = new Collections("", "SSSAre you sure", DateTime.Now.ToShortDateString());
            Collections collection11 = new Collections("", "WPF中,怎样使自定义控件填满grid的一个单元格", DateTime.Now.ToShortDateString());
            Collections collection12 = new Collections("", "WPF中,怎样使自定义控件填满grid的一个单元格", DateTime.Now.ToShortDateString());
            Collections collection13 = new Collections("", "WPF中,怎样使自定义控件填满grid的一个单元格", DateTime.Now.ToShortDateString());
            Collections collection14 = new Collections("", "WPF中,怎样使自定义控件填满grid的一个单元格", DateTime.Now.ToShortDateString());
            List<Collections> listCollection = new List<Collections>();
            listCollection.Add(collection01);
            listCollection.Add(collection02);
            listCollection.Add(collection03);
            listCollection.Add(collection04);
            listCollection.Add(collection05);
            listCollection.Add(collection06);
            listCollection.Add(collection07);
            listCollection.Add(collection08);
            listCollection.Add(collection09);
            listCollection.Add(collection10);
            listCollection.Add(collection11);
            listCollection.Add(collection12);
            listCollection.Add(collection13);
            listCollection.Add(collection14);
            return listCollection;
        }
    }
}
